<ion-view view-title="{{title}}库存" class="inventory-list" show-tabs>
	<div class="row bar bar-subheader bar-dark data-head inter-head">
		<div class="col" text-filter>
			<span class="col-item" ng-click="toggleFilter()">机型<i class="ion-funnel icon-right"></i></span>
		</div>
		<div class="col col-fixed text-right">
			<span class="col-item" reorder="qty" ng-click="orderList()">
				库存量
				<i ng-class="{'ion-arrow-up-b': order=='qty','ion-arrow-down-b': order=='-qty'}" class="icon-right"></i>
			</span>
		</div>
	</div>
	<ion-content class="has-subheader has-footer data-body">
		<div class="list accordion-list">
			<div ng-repeat="item in inventoryList | filter:filter | orderBy:order" class="item">
				<div class="item-row row row-center arrow right-bottom-arrow" ng-click="toggleItem(item)" ng-class="{on: isItemShown(item)}">
					<div class="col"><i class="icon-block" ng-class="{'ion-ios-locked royal': item.islocked}"> </i>{{item.brand_name}} {{item.model}}</div>
					<div class="col col-fixed text-right">{{ item.qty }}部</div>
				</div>
				<div class="item-accordion" ng-if="isItemShown(item)">
					<div class="button-bar">
						<a class="button button-icon" un-lock-inventory ng-click="toggleLock(item)">
							<i class="icon icon-top royal" ng-class="{'ion-ios-locked': !item.islocked,'ion-ios-unlocked': item.islocked}"></i>
							<span ng-bind="lockText(item.islocked)"></span>
						</a>
						<a class="button button-icon" digest-inventory-popup ng-click="showConfirm()">
							<i class="icon icon-top ion-arrow-graph-down-right royal"></i>
							销库存
						</a>
						<a class="button button-icon" ui-sref="app.inventory-detail({_id:item._id})">
							<i class="icon icon-top ion-ios-location royal"></i>
							库存分布
						</a>
					</div>
				</div>
			</div>
		</div>
	</ion-content>

  <div class="bar bar-footer bar-dark row row-center inherit-height">
	  <h4 class="padding-left">合计：</h4>
	  <div class="col text-right">
	  	<span class="padding-right"><span class="royal">{{subtotal.totalCount}}</span> 件</span>
	  	<span ng-if="subtotal.totalValue">总值：<span class="royal">{{subtotal.totalValue | currency:'￥'}}</span></span>
	  </div>
	</div>
</ion-view>
